package raft.rpc;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class Request<T> implements Serializable {

    /** 请求投票 */
    public static final int R_VOTE = 0;
    /** 附加日志 */
    public static  final int A_ENTRIES = 1;
    /** 客户端 */
    public static  final int CLIENT_REQ = 2;
    /** 配置变更 Add */
    public static  final int CHANGE_CONFIG_ADD = 3;
    /** 配置变更 Delete */
    public static  final int CHANGE_CONFIG_REMOVE = 4;

    private int cmd = -1;


    private T obj;

    String url;

    public Request(){

    }

    public Request(T obj){this.obj = obj;}

    public Request(int cmd , T obj , String url){
        this.cmd = cmd;
        this.obj = obj;
        this.url = url;
    }

}
